package com.inspur.demo.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.FeignClientsConfiguration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


//fallback 指定一个回退类，这个类必须实现@FeignClient声明的接口,并且在spring context中
@FeignClient(value = "spring-cloud-producer", configuration = FeignClientsConfiguration.class, fallback = FeignTestClient1Fallback.class)
public interface FeignTestClient1 {

    @GetMapping("/feign/get/{id}")
    String get(@PathVariable("id") String id);
}
